package com.csdj.server.controller;


import com.csdj.server.pojo.Menu;
import com.csdj.server.service.IMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ZouLi
 * @since 2022-12-12
 */
@RestController
@RequestMapping("/system/config")
@Api(tags = "菜单控制类")
public class MenuController {

    // 注入menuService
    @Autowired
    private IMenuService menuServiceImpl;

    @GetMapping("/menu")
    @ApiOperation(value = "根据当前用户权限获取菜单列表")
    public List<Menu> getMenuList() {
        return menuServiceImpl.getMenusByUserId();
    }
}
